package com.fhz.module_mine;

import androidx.lifecycle.LiveData;

import com.fhz.core_lib.api.UserApi;
import com.fhz.core_lib.entity.LoggedInUser;
import com.fhz.core_lib.mvvm.BaseViewModel;
import com.fhz.core_lib.utils.ApiResponse;
import com.fhz.core_lib.utils.RetrofitFactory;

public class MineViewModel extends BaseViewModel<MineRepository> {


    public MineViewModel(MineRepository repositroy) {
        super(repositroy);
    }

    public LiveData<ApiResponse<String>> getQiNiuToken() {
        return repositroy.getQiNiuToken();
    }

    //更新头像
    public LiveData<ApiResponse<LoggedInUser>> updateUser(String nickname , String headImg){
        UserApi userApi = RetrofitFactory.getRetrofitFactory().create(UserApi.class);
        return userApi.updateUser(nickname,headImg);
    }
}